#ifndef HUD_STATS_H
#define HUD_STATS_H
#include "../core/screen.h"
class sprite;
class actor;
class hud_stats : public screen {
protected:
    actor *target = nullptr;
    sprite *hp_bar = nullptr;
    sprite *hp_bar_bg = nullptr;
    sprite *hp_bar_icon = nullptr;
    sprite *mp_bar  = nullptr;
    sprite *mp_bar_bg = nullptr;
    sprite *mp_bar_icon = nullptr;
    float hp_percent = 0.0f;
    float mp_percent = 0.0f;
public:
    virtual void init() override;
    virtual void update(float dt) override;
    static hud_stats* createHubStats(node *parent,actor *target,glm::vec2 render_position);

    actor* getTarget() { return target; }
    sprite* getHpBar() { return hp_bar; }
    sprite* getHpBarBg() { return hp_bar_bg; }
    sprite* getHpBarIcon() { return hp_bar_icon; }
    sprite* getMpBar() { return mp_bar; }
    sprite* getMpBarBg() { return mp_bar_bg; }
    sprite* getMpBarIcon() { return mp_bar_icon; }
    float getHpPercent() { return hp_percent; }
    float getMpPercent() { return mp_percent; }
    void setTarget(actor *target) { this->target = target; }
    void setHpPercent(float hp_percent) { this->hp_percent = hp_percent; }
    void setMpPercent(float mp_percent) { this->mp_percent = mp_percent; }
private:
    void updateHpBar(float dt);
    void updateMpBar(float dt);
};

#endif // HUD_STATS_H